package com.sokal.easycare.modules.position.entity;

import org.hibernate.validator.constraints.Length;
import com.sokal.easycare.modules.sys.entity.MainUser;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.sokal.easycare.common.persistence.DataEntity;

/**
 * 岗位人员Entity
 * @author yangmin
 * @version 2017-04-08
 */
public class PartyRole extends DataEntity<PartyRole> {
	
	private static final long serialVersionUID = 1L;
	private String partyRoleId;		// id
	private MainUser user;		// 用户
	private Duty duty;		// 岗位
	private Date effDate;		// eff_date
	private Date expDate;		// exp_date
	private String state;		// state
	
	public PartyRole() {
		super();
	}

	public PartyRole(String id){
		super(id);
	}

	@Length(min=1, max=42, message="id长度必须介于 1 和 42 之间")
	public String getPartyRoleId() {
		return partyRoleId;
	}

	public void setPartyRoleId(String partyRoleId) {
		this.partyRoleId = partyRoleId;
	}
	
	@NotNull(message="用户不能为空")
	public MainUser getUser() {
		return user;
	}

	public void setUser(MainUser user) {
		this.user = user;
	}
	
	
	public Duty getDuty() {
		return duty;
	}

	public void setDuty(Duty duty) {
		this.duty = duty;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEffDate() {
		return effDate;
	}

	public void setEffDate(Date effDate) {
		this.effDate = effDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getExpDate() {
		return expDate;
	}

	public void setExpDate(Date expDate) {
		this.expDate = expDate;
	}
	
	@Length(min=0, max=3, message="state长度必须介于 0 和 3 之间")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
}